﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ProjectRoughWork
{
    class Cover : BaseActor
    {
        /// <summary>
        /// Default constructor. Initializs list of cover points
        /// </summary>

        public Cover()
        {
            coverPoints = new List<Vector3>();
        }

        /// <summary>
        /// Property for Cover Points
        /// </summary>

        public List<Vector3> CoverPoints
        {
            get { return coverPoints; }
            set { coverPoints = value; }
        }

        /// <summary>
        /// Checks to see if a particular cover point is currently occupied
        /// </summary>
        /// <param name="index">The index of the cover point to test</param>
        /// <returns>True if the cover point is occupied, false if the cover point is vacant</returns>

        public bool CheckIfCoverPointOccupied(int index)
        {
            return coverStatus[index];
        }

        /// <summary>
        /// Initalizes the status of the cover points to vacant. 
        /// </summary>

        public void InitCoverStatus()
        {
            coverStatus = new bool[coverPoints.Count];
            for (int index = 0; index < coverPoints.Count; index++)
            {
                coverStatus[index] = false;   
            }
        }

        /// <summary>
        /// Changes status of the cover point to the status given
        /// </summary>
        /// <param name="coverPointIndex">The index of the cover point to modified</param>
        /// <param name="status">The status to change the status of the cover point</param>

        public void ChangeCoverStatus(int coverPointIndex, bool status)
        {
            coverStatus[coverPointIndex] = status;
        }

        //Data Members

        List<Vector3> coverPoints;      //List of points of cover associated with the cover
        bool[] coverStatus;             //status list of the cover points
        bool occupied;                  

    }
}
